<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'accountCity.label', default: 'AccountCity')}"/>
    <title>机构城市管理</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>机构城市管理</span>
                    </li>
                </ol>
            </div>
            <h2 class="font-light m-b-xs">
                机构城市管理
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="index">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit"><i class="fa fa-search"></i>查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn"><i class="fa fa-times"></i>重置</button>
                    </div>
                    查询
                </div>

                <div class="panel-body form-horizontal">
                    <div class="col-md-3 form-group">
                        <label for="name" class="col-sm-3 control-label">机构名称</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control" name="name" id="name" value="${params?.name}" placeholder="请输入机构名称">
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>


    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                机构列表
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center">
                        <thead>
                        <tr>
                            <g:sortableColumn property="id" title="机构名称" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="type" title="机构类型" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="level" title="机构级别" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="parent" title="上级机构" class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="address" title="机构地址" class="col-md-1 text-center" params="${params}"/>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${accountList}">
                            <tr align="center">
                                <td>
                                    <g:link style="color: #3498DB" action="show" params="[id: it?.id]">${it?.name}</g:link>
                                </td>
                                <td>${it?.type?.name}</td>
                                <td>${it?.level?.name}</td>
                                <td>${it?.parent?.name}</td>
                                <td>${it?.address}</td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate total="${accountCount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>
</div>

<g:javascript>
    $(function () {
        $("#resetBtn").click(function () {
            $("#name").val("");
        });
    });
</g:javascript>
</body>
</html>
